//
//  HomeBannerCell.m
//  AppNew
//
//  Created by 华伟 on 2019/4/12.
//  Copyright © 2019 华伟. All rights reserved.
//

#import "HomeBannerCell.h"
@interface HomeBannerCell ()
@property (nonatomic, weak) UIImageView *bannerView;
@end
@implementation HomeBannerCell
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor clearColor];
        [self initView];
    }
    return self;
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    if (self = [super initWithCoder:aDecoder]) {
        self.backgroundColor = [UIColor clearColor];
        [self initView];
    }
    return self;
}

- (void)setBanner:(NSString *)banner{
    if(_banner != banner){
        _banner = banner;
        _bannerView.image = [UIImage imageNamed:_banner];
    }
}

- (void)initView {
    
    UIImageView *imgV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.t_width, self.t_height)];
    [self addSubview:imgV];
    _bannerView = imgV;
    _bannerView.contentMode = UIViewContentModeScaleToFill;
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    _bannerView.frame = self.bounds;
}

@end

